<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libcoap: coap_hashkey.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">libcoap<span id="projectnumber">&#160;4.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('coap__hashkey_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">coap_hashkey.h File Reference</div></div>
</div><!--header-->
<div class="contents">

<p>definition of hash key type and helper functions  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="libcoap_8h_source.html">libcoap.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="uthash_8h_source.html">uthash.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="str_8h_source.html">str.h</a>&quot;</code><br />
</div>
<p><a href="coap__hashkey_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a7367053289edae33b9f02771d89b0ffa" id="r_a7367053289edae33b9f02771d89b0ffa"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__hashkey_8h.html#a7367053289edae33b9f02771d89b0ffa">coap_hash</a>(String,  Length,  Result)&#160;&#160;&#160;  <a class="el" href="coap__hashkey_8c.html#a1f8fb366d21f56f2e619c42a516114f6">coap_hash_impl</a>((String),(Length),(Result))</td></tr>
<tr class="separator:a7367053289edae33b9f02771d89b0ffa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adb14790be7c0d02991bcc19138efd99d" id="r_adb14790be7c0d02991bcc19138efd99d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__hashkey_8h.html#adb14790be7c0d02991bcc19138efd99d">COAP_DEFAULT_HASH</a></td></tr>
<tr class="separator:adb14790be7c0d02991bcc19138efd99d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aab841b0811b13cfb044f82718114b196" id="r_aab841b0811b13cfb044f82718114b196"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__hashkey_8h.html#aab841b0811b13cfb044f82718114b196">coap_str_hash</a>(Str,  H)</td></tr>
<tr class="memdesc:aab841b0811b13cfb044f82718114b196"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calls <a class="el" href="coap__hashkey_8h.html#a7367053289edae33b9f02771d89b0ffa">coap_hash()</a> with given <code><a class="el" href="structcoap__string__t.html" title="Coap string data definition.">coap_string_t</a></code> object as parameter.  <br /></td></tr>
<tr class="separator:aab841b0811b13cfb044f82718114b196"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a14b49ce1f8be4059e84df8e9d2a19586" id="r_a14b49ce1f8be4059e84df8e9d2a19586"><td class="memItemLeft" align="right" valign="top">typedef unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__hashkey_8h.html#a14b49ce1f8be4059e84df8e9d2a19586">coap_key_t</a>[4]</td></tr>
<tr class="separator:a14b49ce1f8be4059e84df8e9d2a19586"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a1f8fb366d21f56f2e619c42a516114f6" id="r_a1f8fb366d21f56f2e619c42a516114f6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="coap__hashkey_8h.html#a1f8fb366d21f56f2e619c42a516114f6">coap_hash_impl</a> (const unsigned char *s, unsigned int len, <a class="el" href="coap__hashkey_8h.html#a14b49ce1f8be4059e84df8e9d2a19586">coap_key_t</a> h)</td></tr>
<tr class="memdesc:a1f8fb366d21f56f2e619c42a516114f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates a fast hash over the given string <code>s</code> of length <code>len</code> and stores the result into <code>h</code>.  <br /></td></tr>
<tr class="separator:a1f8fb366d21f56f2e619c42a516114f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>definition of hash key type and helper functions </p>

<p class="definition">Definition in file <a class="el" href="coap__hashkey_8h_source.html">coap_hashkey.h</a>.</p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="adb14790be7c0d02991bcc19138efd99d" name="adb14790be7c0d02991bcc19138efd99d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adb14790be7c0d02991bcc19138efd99d">&#9670;&#160;</a></span>COAP_DEFAULT_HASH</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define COAP_DEFAULT_HASH</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__hashkey_8h_source.html#l00040">40</a> of file <a class="el" href="coap__hashkey_8h_source.html">coap_hashkey.h</a>.</p>

</div>
</div>
<a id="a7367053289edae33b9f02771d89b0ffa" name="a7367053289edae33b9f02771d89b0ffa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7367053289edae33b9f02771d89b0ffa">&#9670;&#160;</a></span>coap_hash</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define coap_hash</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">String, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Length, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Result&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;  <a class="el" href="coap__hashkey_8c.html#a1f8fb366d21f56f2e619c42a516114f6">coap_hash_impl</a>((String),(Length),(Result))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__hashkey_8h_source.html#l00036">36</a> of file <a class="el" href="coap__hashkey_8h_source.html">coap_hashkey.h</a>.</p>

</div>
</div>
<a id="aab841b0811b13cfb044f82718114b196" name="aab841b0811b13cfb044f82718114b196"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aab841b0811b13cfb044f82718114b196">&#9670;&#160;</a></span>coap_str_hash</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define coap_str_hash</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">Str, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">H&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calls <a class="el" href="coap__hashkey_8h.html#a7367053289edae33b9f02771d89b0ffa">coap_hash()</a> with given <code><a class="el" href="structcoap__string__t.html" title="Coap string data definition.">coap_string_t</a></code> object as parameter. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Str</td><td>Must contain a pointer to a coap string object. </td></tr>
    <tr><td class="paramname">H</td><td>A coap_key_t object to store the result. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="coap__hashkey_8h_source.html#l00053">53</a> of file <a class="el" href="coap__hashkey_8h_source.html">coap_hashkey.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="a14b49ce1f8be4059e84df8e9d2a19586" name="a14b49ce1f8be4059e84df8e9d2a19586"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a14b49ce1f8be4059e84df8e9d2a19586">&#9670;&#160;</a></span>coap_key_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef unsigned char coap_key_t[4]</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__hashkey_8h_source.html#l00022">22</a> of file <a class="el" href="coap__hashkey_8h_source.html">coap_hashkey.h</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a1f8fb366d21f56f2e619c42a516114f6" name="a1f8fb366d21f56f2e619c42a516114f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1f8fb366d21f56f2e619c42a516114f6">&#9670;&#160;</a></span>coap_hash_impl()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_hash_impl </td>
          <td>(</td>
          <td class="paramtype">const unsigned char *&#160;</td>
          <td class="paramname"><em>s</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="coap__hashkey_8h.html#a14b49ce1f8be4059e84df8e9d2a19586">coap_key_t</a>&#160;</td>
          <td class="paramname"><em>h</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculates a fast hash over the given string <code>s</code> of length <code>len</code> and stores the result into <code>h</code>. </p>
<p>Depending on the exact implementation, this function cannot be used as one-way function to check message integrity or simlar.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">s</td><td>The string used for hash calculation. </td></tr>
    <tr><td class="paramname">len</td><td>The length of <code>s</code>. </td></tr>
    <tr><td class="paramname">h</td><td>The result buffer to store the calculated hash key. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="coap__hashkey_8c_source.html#l00012">12</a> of file <a class="el" href="coap__hashkey_8c_source.html">coap_hashkey.c</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_a14d23a24002734ac2a3b997119f008e.html">coap2</a></li><li class="navelem"><a class="el" href="coap__hashkey_8h.html">coap_hashkey.h</a></li>
    <li class="footer">Generated on Fri Dec 27 2024 09:57:44 for libcoap by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
  </ul>
</div>
</body>
</html>
